// IronyToExpressionFilter.cs created with MonoDevelop
// User: jeremie at 16:05 02/01/2009
//
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
//

using System;
using System.Linq;
using System.Collections.Generic;

using Irony.Compiler;
using Microsoft.Linq;
using Microsoft.Linq.Expressions;

namespace Bechamel
{
	public class IronyToExpressionFilter : BaseFilter<AstNode, Expression>
	{
		ETGenerator generator = new ETGenerator();
		
		protected override Expression Transformation (AstNode input)
		{
			Expression block = ((BechamelNode)input).GenerateExpression(generator);

			return Expression.Scope(block, generator.Defines);
		}
	}
}
